Image binarization refers to the process of converting an image represented by pixel values which may assume multiple levels to pixel values which can be one of two values, e.g., a first value corresponding to foreground and a second value corresponding to background. Image binarization can be used to convert a grayscale or a color image to a black and white image. Frequently, binarization is used as the pre-processing step of document image processing. For example, barcodes are typically captured as grayscale or color images that may require binarization as a first step before processing to decode the barcode to ascertain its value. Similarly, optical character recognition (OCR) algorithms may require binarization as a first step.
One approach to performing image binarization is to choose a single threshold value and classify each of the pixels of the image with values above this threshold as white and each of the other pixels as black. This can be much faster than a locally adaptive binarization method and therefore a good choice when speed is a major consideration. Such a method works well for many images, particularly when the distribution of pixel values has distinct characteristics.
A still unsolved problem is to determine the best global threshold value to use. There are known methods, such as the clustering method due to Otsu for example, for computing a global threshold by using statistics of the distribution of pixel values that work reasonably well but they do not always choose the best value. There remains a need for a better way to find the best global threshold value for a particular image.
Another unsolved problem is to reliably recognize whether or not an image is a good candidate for global binarization instead of locally adaptive binarization where the image must be processed pixel-by-pixel and a threshold specifically computed for each pixel. There remains a need for a better way to make that choice.